Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG REPORT: failed to build on kustomize 3.0.0. #1318

Closed
wants to merge 1 commit into from

Conversation

yujunz
Copy link
Member

@yujunz yujunz commented Jul 8, 2019

Observed:

  • It fails to patch object in base
  • It can patch object in resources
  • It works on bundled kustomize (v2.0.3) in kubectl v1.15
❯ kustomize version
Version: {KustomizeVersion:3.0.0 GitCommit:e0bac6ad192f33d993f11206e24f6cda1d04c4ec BuildDate:2019-07-03T18:21:24Z GoOs:darwin GoArch:amd64}

❯ kustomize build examples/patches-no-matches
Error: no matches for OriginalId extensions_v1beta1_Deployment|~X|k8s-sidecar-injector-prod; no matches for CurrentId extensions_v1beta1_Deployment|~X|k8s-sidecar-injector-prod; failed to find unique target for patch extensions_v1beta1_Deployment|k8s-sidecar-injector-prod

❯ kustomize build examples/patches-no-matches/base
apiVersion: extensions/v1beta1
kind: Deployment
...

❯ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-20T04:49:16Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.6", GitCommit:"b1d75deca493a24a2f87eb1efde1a569e52fc8d9", GitTreeState:"clean", BuildDate:"2018-12-16T04:30:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

❯ kubectl kustomize examples/patches-no-matches
apiVersion: extensions/v1beta1
kind: Deployment
...

Observed:

* It fails to patch object in base
* It can patch object in resources
* It works on bundled kustomize (v2.0.3) in kubectl v1.15

```
❯ kustomize version
Version: {KustomizeVersion:3.0.0 GitCommit:e0bac6ad192f33d993f11206e24f6cda1d04c4ec BuildDate:2019-07-03T18:21:24Z GoOs:darwin GoArch:amd64}

❯ kustomize build examples/patches-no-matches
Error: no matches for OriginalId extensions_v1beta1_Deployment|~X|k8s-sidecar-injector-prod; no matches for CurrentId extensions_v1beta1_Deployment|~X|k8s-sidecar-injector-prod; failed to find unique target for patch extensions_v1beta1_Deployment|k8s-sidecar-injector-prod

❯ kustomize build examples/patches-no-matches/base
apiVersion: extensions/v1beta1
kind: Deployment
...

❯ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-20T04:49:16Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.6", GitCommit:"b1d75deca493a24a2f87eb1efde1a569e52fc8d9", GitTreeState:"clean", BuildDate:"2018-12-16T04:30:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

❯ kubectl kustomize examples/patches-no-matches
apiVersion: extensions/v1beta1
kind: Deployment
...
```
@k8s-ci-robot k8s-ci-robot requested review from justinsb and monopole July 8, 2019 06:05
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yujunz
To complete the pull request process, please assign liujingfang1
You can assign the PR to them by writing /assign @liujingfang1 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2019
@Liujingfang1
Copy link
Contributor

This is the expected behavior. In the Deployment from the base, it has the namespace as kube-system. In the overlay patch, it doesn't have namespace. When kustomize looks for a patch target, it matches by group, version, kind, name and namespace.

@yujunz
Copy link
Member Author

yujunz commented Jul 9, 2019

When kustomize looks for a patch target, it matches by group, version, kind, name and namespace.

Make sense. Didn't notice this break change in v3.0.0.

@yujunz yujunz closed this Jul 9, 2019
@yujunz yujunz deleted the patches-no-matches branch July 9, 2019 02:46
@Liujingfang1
Copy link
Contributor

Liujingfang1 commented Jul 9, 2019

This PR is related to the failure you reported.
https://github.com/kubernetes-sigs/kustomize/pull/1317/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants